This archive contains the materials necessary to reproduce all results reported in:

Isaac D. Mehlhaff. "A Group-Based Approach to Measuring Polarization." American Political Science Review. August 2023.

Archive contents and associated variables:

1. cses_imd.rdata -  R data object containing the Comparative Study of Electoral Systems Integrated Module Dataset
    * see codebook at https://cses.org/data-download/cses-integrated-module-dataset-imd/
2. HSall_members.csv - dataset of DW-NOMINATE ideal point estimates
    * see codebook at https://voteview.com/articles/data_help_members
3. NOMINATE_parties.csv - dataset linking DW-NOMINATE party codes to party names
    * party_code: party code used by DW-NOMINATE
    * party: party names, simplified by converting non-major parties to the parties from which they previously splintered off from or with which they later merged
4. party_unity_scores.csv - dataset linking Congresses to party unity scores
    * see codebook at https://www.brookings.edu/wp-content/uploads/2017/01/vitalstats_ch8_tbl4.pdf
5. results-elites-*.rdata - R data objects containing elite ideological ideal points from Germany, Italy, the Netherlands, Spain, the UK, and the US, estimated from Twitter data
    * see codebook at https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/26589
6. literature_analysis.csv - dataset of codes for existing polarization literature
    * publication: journal name
    * title: article title
    * author: article author(s)
    * year: year published
    * difference_distance: article uses difference-in-means or other formulation of distance
    * variance_homogeneity: article uses variance or other formulation of homogeneity
    * bimodality: article uses bimodality
    * overlap: article uses overlap between at least two distributions
    * importance: article uses issue importance
    * party_unity: article uses party unity
    * correlation: article uses correlation among issue positions
    * r_squared: article uses R^2, typically of party on issue positions
    * party_votes: article uses in-party voting behavior
    * seat_proportion: article uses proportions of seats held by party
    * regression_coef: article uses regression coefficients, typically of party on issue positions
    * same_party_clerk: article uses indication of same-party legal clerks
    * share_extreme: article uses share of extreme party members or issue positions
    * party_control: article uses party control of legislative chamber(s)
    * social_distance: article uses social distance among partisans
    * coalition_size: article uses size of party coalition
    * network_separation: article uses degree of party network separation
    * outparty_opinion: article uses extent of agreement with out-party
    * time: article uses time as proxy
    * engagement: article uses cognitive engagement
    * unspecified: article does not provide sufficient detail on operationalization
    * none: article does not operationalize polarization
7. label_dist.RData - R data object containing data used to produce stylized plots for human annotation task
    * label: cluster indicator
    * value: value of point in synthetic ideology space
8. label_data.csv - dataset of human annotations of stylized plots
    * ResponseId: randomly generated string to identify response
    * X*_compare: respondent's indication of which distribution appeared more polarized; corresponds to list of distributions in label_dist.RData
    * X*_compare_DO: distribution numbers presented to respondents; corresponds to list of distributions in label_dist.RData
9. V-Dem-CPD-Party-V2.csv - dataset of expert-coded party ideology 
    * see codebook at https://v-dem.net/data/v-party-dataset/
10. polarization_labeling_task.pdf - PDF of survey wordings used for human annotation task
11. sessionInfo.txt - plain text file detailing the compute configuration used to produce results
12. CPC_APSR.R - R script used to produce all results
13. stargazer_fix.R - R script to patch a known issue in stargazer <= 5.2.3 running on R >= 4.2. Optionally called from CPC_APSR.R
14. IRB_letter.pdf - PDF of IRB exemption letter
15. supplementary_information.pdf - PDF of supplementary information
16. replication_supplement.pdf - PDF of additional supplementary materials for replication archive

Please see the main text for external data citations. Codebooks for external datasets are available from these citations. 

Instructions to replicate results:

1. Make sure R working directory is set to the location where all files listed above are saved.
2. Run CPC_APSR.R. 
